
file_path = '31Bwhat\\3b_D.txt'

scores_list = []

with open(file_path, 'r') as file:
    for line in file:
        line = line.strip()
        if ':' in line:
            # 分割并获取分数部分
            parts = line.split(':')
            if len(parts) > 1:
                try:
                    # 转换分数为浮点数并添加到列表
                    score = float(parts[1].strip())
                    scores_list.append(score)
                except ValueError:
                    print(f"Error converting to float: {line}")
            else:
                print(f"Invalid format: {line}")
        else:
            print(f"Missing delimiter '-': {line}")

# 打印所有有效提取的分数
print(scores_list)
total_score = sum(scores_list)
print(f"The total sum of all scores is: {total_score}")